package net.zjitc.androidclassthread;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    TextView tv, tv2, tv3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        init();
        Thread curr;
        int num = 7;
        curr = Thread.currentThread();
        curr.setPriority(num);
        tv.setText("Thread:" + curr);
        tv2.setText("Thread名:" + curr.getName());
        tv3.setText("优先级:" + curr.getPriority());
    }

    private void init() {
        tv = findViewById(R.id.tv);
        tv2 = findViewById(R.id.tv2);
        tv3 = findViewById(R.id.tv3);
    }

}
